//
//  AppDelegate.m
//  wdj
//
//  Created by 蓝鳍互娱 on 2024/7/8.
//

#import "AppDelegate.h"
#import "WDJHomeController.h"
@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    WDJHomeController * homeCtrl = [[WDJHomeController alloc] init];
    UINavigationController *homeNavCtrl = [[UINavigationController alloc] initWithRootViewController:homeCtrl];
    
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    self.window.rootViewController = homeNavCtrl;
    [self.window makeKeyAndVisible];
//    [self updataFreeVip];
    [[WDJPublicData defaultManager] updataPublicData];
    [WDJHttpHelper wdjMakeVipPrice];
    return YES;
}
- (void)updataFreeVip{
    NSDate *curDate = [NSDate date];
    NSCalendar *curCalendar = [NSCalendar currentCalendar];
    NSDateComponents *curDateComponent = [[NSDateComponents alloc] init];
    [curDateComponent setYear:1];
    NSDate *addDate = [curCalendar dateByAddingComponents:curDateComponent toDate:curDate options:0];
    NSTimeInterval curTime = [addDate timeIntervalSince1970];
    [[NSUserDefaults standardUserDefaults] setDouble:(double)curTime forKey:@"wdjVipBuyTime"];
}
@end
